<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>同城交友</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <script src="Content/wechat/js/jquery.min.js"></script>
    <link href="Content/wechat/css/tongChengJiaoYou.css" rel="stylesheet" type="text/css">
    <link href="Content/wechat/css/linLiSheQu.css" rel="stylesheet" type="text/css">
    <!--页码-->
    <link href="Content/wechat/css/myPagination.css" rel="stylesheet" type="text/css">
    <!--字体缩放-->
    <script src="Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--页码js-->
    <script src="Content/wechat/js/myPagination.js"></script>
</head>
<body>
<header class="header">
    <h4>同城交友</h4>
    <!--    <ul class="header_ul clearfix">-->
    <!--        <li>-->
    <!--            <span>-->
    <!--                <img src="Content/wechat/images/wz.png">-->
    <!--            </span>-->
    <!--            <p>6</p>-->
    <!--        </li>-->
    <!--        <li>-->
    <!--            <span>-->
    <!--                <img src="Content/wechat/images/z.png">-->
    <!--            </span>-->
    <!--            <p>6</p>-->
    <!--        </li>-->
    <!--        <li>-->
    <!--            <span>-->
    <!--                <img src="Content/wechat/images/pl.png">-->
    <!--            </span>-->
    <!--            <p>6</p>-->
    <!--        </li>-->
    <!--    </ul>-->
    <div class="fabu">
        <a href="/wechat/forum/add?type=同城交友">发布信息</a>
    </div>

</header>

<div class="liuYan">
    <div class="liuYan_box" id="liuYan_box">

        <!--        <div class="liuYan_box_1">-->
        <!--            <div class="name_up clearfix">-->
        <!--                <img src="Content/wechat/images/header.jpg">-->
        <!--                <p>Hello</p>-->
        <!--                <span class="v"></span>-->
        <!--                <u>2019-12-02</u>-->
        <!--            </div>-->
        <!--            <div class="neiRong_c" onclick=window.location="/wechat/forum/tongCheng_xx">-->
        <!--                <h4>漠河是大兴安岭地区县级市</h4>-->
        <!--                <p>近期计划去漠河旅游，我打算带上我一家人（四大一小）去玩玩，问下去玩几天比较合适，请问去过的要怎么样玩比较省心省钱少走弯路</p>-->
        <!--            </div>-->
        <!--            <div class="fenLei_down">-->
        <!--                <span class="tcjy">同城交友</span>-->
        <!--            </div>-->
        <!--        </div>-->
    </div>
    <!--页码-->
    <div id="pagination" class="pagination"></div>
</div>
<script>
    var pageTotal = 0;   //总页数
    var pageSize = 3;    //一页显示几个
    window.onload = function () {
        InitAjax(1);
    }

    function onLoadPaging() {
        new myPagination({
            id: 'pagination',
            curPage: 1, //初始页码
            pageTotal: pageTotal, //总页数
            pageAmount: pageSize,  //每页多少条
            pageSize: 2, //可选,分页个数

            getPage: function (page) {
                //获取当前页数
                InitAjax(page)
            }
        })
    }

    function InitAjax(pageNum) {
        $.ajax({
            url: "/wechat/forum/list",
            type: 'post',
            dataType: 'json',
            data: {
                pagination: "{page:\"" + pageNum + "\",rows:\"" + pageSize + "\",sidx:\"\",sord:\"\"}",
                type: "同城交友"
            }, success: function (result) {
                ajaxCallBack(result);
            }

        })
    }

    function ajaxCallBack(data) {
        var insetViewData = ""; //视图数据
        $.each(data.data.rows, function (index, items) {
            var content = "";
            insetViewData += "<div class=\"liuYan_box_1\">\n" +
                "            <div class=\"name_up clearfix\">\n" +
                "                <img src=\"" + items.headimgurl + "\">\n" +
                "                <p>" + items.nickname + "</p>\n" +
                // "                <span class=\"v\"></span>\n" +
                "                <u>" + items.date + "</u>\n" +
                "            </div>\n" +
                "            <div class=\"neiRong_c\" onclick=window.location=\"/wechat/forum/fornum_info?id="+items.id+"\">\n" +
                "                <h4>" + items.title + "</h4>\n" +
                "                <p>" + items.content + "</p>\n" +
                "            </div>\n" +
                "            <div class=\"fenLei_down\">\n" +
                "                <span class=\"tcjy\">同城交友</span>\n" +
                "            </div>\n" +
                "        </div>";

        });
        $("#liuYan_box").html(insetViewData);
        if (pageTotal == 0) {
            pageTotal = data.data.total;
            onLoadPaging()
        }
    }


</script>
<!--end 页码-->
<!--end 页码-->


<!--页尾-->
<script type="text/javascript" src="Content/wechat/js/foot.js"></script>
</body>
</html>
